﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Autofac;
using Autofac.Integration.Mvc;
using FreedBack.WebInfrastructure;

namespace FreedBack.Application.Modules
{
    public class MvcUiModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterControllers(ThisAssembly);
            builder.RegisterModelBinders(ThisAssembly);
            builder.RegisterModelBinderProvider();

            builder
                .RegisterType<MvcWebRequest>()
                .AsImplementedInterfaces()
                .InstancePerLifetimeScope();
        }
    }
}